package com.bluewave.goaltracker;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;

public class DialogActivity extends Activity{
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		CharSequence contentTitle = getIntent().getExtras().getCharSequence("title");
		CharSequence contentText = getIntent().getExtras().getCharSequence("content");
		alertDialog(contentTitle, contentText);
		
	}
	
	private void alertDialog(CharSequence contentTitle, CharSequence contentText){
		AlertDialog.Builder builder = new AlertDialog.Builder(this);
		   builder.setMessage(contentText)
		   		  .setTitle(contentTitle)
		          .setCancelable(false)
		          .setNegativeButton("Close", new DialogInterface.OnClickListener() {
		              public void onClick(DialogInterface dialog, int id) {
		                   dialog.cancel();
		              }
		          });
		   AlertDialog alert = builder.create();
		   alert.setIcon(R.drawable.ic_status_bar);
		   try{
			   alert.show();
			   
		   }catch (Exception e) {
			   e.fillInStackTrace();
		}
		   
	}
}
